<template>
    <div>
      <title-bar title="个人页面"></title-bar>
      <div class="profile">
        <div class="profile-info">
          <img class="profile-pic" :src="avatar" alt="头像">
          <div class="profile-nickname">{{ nickname || '火星人' }}</div>
          <div class="profile-id">时辰号: {{ number || "未知" }}</div>
          <!--<div class="profile-buttons">
            <button class='button-message'>发消息</button>
            <button class='button-contact'>添加到通讯录</button>
          </div>-->
        </div>
        <div class="profile-activity">
          <div class="activity-title">他的日程</div>
          <ul class="activity-items">
            <li class="activity-item">
              <ul>
                <li>
                  <div class="item-date">8月4日 星期四</div>
                  <div class="item-info">
                    <div class="item-hours lineheight">
                      <div class="font12 text">14:00</div>
                      <div class="font12 subtext">18:00</div>
                    </div>
                    <div class="item-message">
                      <div class="item-text font14 text">描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述</div>
                      <div class="font10 subtext"> 标签 标签 标签 标签</div>
                    </div>
                  </div>
                </li>
              </ul>
            </li>
          </ul>
        </div>
      </div>
    </div>
</template>

<script>
import Vue from 'vue';
import TitleBar from '../components/TitleBar';
import EventEmitter from "../common/EventEmitter.js";
import * as user from "../../services/user.js";
import storage from "../../services/storage.js";
import {UserPostService} from '../../services/userpost.js';
import {DEFAULT_AVATAR} from "../../const"

export default{
  components:{},
  route:{
    async data(){
      await storage.getUser().then(({ user })=>{
        this.nickname = user.nickName
        this.number = user.userName
        this.avatar = user.avatarUrl? user.avatarUrl: DEFAULT_AVATAR
        this.id = user.id
      });
    }
  },
  data(){
    return{
      nickname: '',
      number: '',
      avatar: null,
      id: '',
      avator: DEFAULT_AVATAR
    }
  },
  methods:{
  },
  init(){
    this.service = new UserPostService
  }
}

</script>

<style lang='sass'>
   @import '../../vendor/styles/profile.scss';
</style>
